package zengqiang.day01

/**
 * 总结;java时声明式语法，没有返回值
 * kotlin时表达式语法，有返回值，所以才有下列的各种写法
 */
fun main(args: Array<String>) {

}
fun max(n1:Int,n2:Int):Int{
    if (n1 > n2) {
        return n1
    }else{
        return n2
    }
}
fun max1(n1:Int,n2:Int):Int{
    if (n1 > n2)
        return n1
    else
        return n2
}
fun max2(n1:Int,n2:Int):Int{
    return if (n1 > n2)
         n1
    else
         n2
}
fun max3(n1:Int,n2:Int):Int{
    if (n1 > n2) return n1 else return n2
}
fun max4(n1:Int,n2:Int):Int{
    return if (n1 > n2) n1 else n2
}


